package com.example.demo3.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo3.domain.User;
import com.example.demo3.domain.bo.UserBo;
import com.example.demo3.mapper.UserMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@RequiredArgsConstructor
public class UserService {

    private final UserMapper userMapper ;

//    @DS("test")
    public List<User> queryForList() {
        return userMapper.selectList(new QueryWrapper<>());
    }

    @Transactional
    public void edit(UserBo userBo) {
        userMapper.edit(userBo);
        userMapper.update(userBo);

    }


}
